<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});


Route::group(['namespace' => 'Api', 'prefix' => 'v1'], function () {

    Route::get('/homeData', 'HomeController@getHomeData');


    /*
     *  user 用户的接口
     */
    Route::get('/userInfo', 'UserController@getUserInfo');              // 用户信息
    Route::post('/user/login', 'UserController@login');                 // 用户登录
    Route::post('/user/register', 'UserController@register');           // 用户注册
    Route::post('/user/logout', 'UserController@logout');               // 用户退出登录


});
